/**
 * 书籍分类
 * @author Qasim <15750783791@163.com>
 * @version2016/10/31
 */
document.addEventListener('plusready' , ready , false);

var self = memberInfo = index_info = '';

function ready(){
	//获取缓存的数据
	index_info = plus.storage.getItem('index_info');
	result = $.parseJSON(index_info);
	
	//分类
	if(result.classify != ''){
		$.each(result.classify , function(k ,v){
			var html  =  '<li class="mui-table-view-cell mui-media mui-col-xs-6 mui-col-sm-6" data-tid="'+v.tid+'">';
		        html +=  '<div class="list"><div class="left-text">'+v.classname+'<p>'+v.num+'</p></div>';
		        html +=  '<div class="right-text"><img src="'+getImgUrl(v.litpic , '../public/img/book.jpg')+'"/></div></div></li>';
		    $('.detail ul').append(html);
		    $('.mui-media').unbind();
		    $('.mui-media').on('click' , function(){
		    	var parameter = {tid : $(this).attr('data-tid')};
		    	goUrl('classify-books.html' , 'classify_books' , parameter)
		    });
		})
	}
	
	
	
	
}
